/*
 * Copyright 2019 Huawei Technologies Co.,Ltd.All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __HISI_TEST_SEC_H
#define __HISI_TEST_SEC_H

enum alg_class {
	CIPHER_CLASS,
	AEAD_CLASS,
	DIGEST_CLASS,
};

enum times_class {
	SECONDS_CLASS,
	CYCLES_CLASS,
};

enum cipher_op_type {
	ENCRYPTION,
	DECRYPTION,
};

enum cipher_alg {
	CIPHER_SM4,
	CIPHER_AES,
	CIPHER_DES,
	CIPHER_3DES,
};

enum cipher_mode {
	ECB,
	CBC,
	CTR,
	XTS,
	OFB
};

struct cipher_testvec {
	char *key;
	int klen;
	const char *iv;
	int ivlen;
	const char *iv_out;
	const char *ptext;
	const char *ctext;
	int len;
};

enum sec_digest_state {
    SEC_DIGEST_INIT = 0,
    SEC_DIGEST_FIRST_UPDATING,
    SEC_DIGEST_DOING,
    SEC_DIGEST_FINAL
};

struct hash_testvec {
	char *key;
	char *plaintext;
	const char *digest;
	unsigned int psize;
	unsigned short ksize;
	unsigned int dsize;
};

struct aead_testvec {
	const char *key;
	const char *iv;
	const char *ptext;
	const char *assoc;
	const char *ctext;
	unsigned char novrfy;
	unsigned char wk;
	unsigned char klen;
	unsigned int plen;
	unsigned int clen;
	unsigned int alen;
	int setkey_error;
	int setauthsize_error;
	int crypt_error;
};

/* 192bit */
struct cipher_testvec des3_ecb_tv_template_192[] = {
	{
	.key	= "\x10\x46\x10\x34\x89\x98\x80\x20"
		  "\x91\x07\xd0\x15\x89\x19\x01\x01"
		  "\x19\x07\x92\x10\x98\x1a\x01\x01",
	.klen	= 24,
	.ptext	= "\x00\x00\x00\x00\x00\x00\x00\x00",
	.ctext	= "\xe1\xef\x62\xc3\x32\xfe\x82\x5b",
	.len	= 8,
	}
};

/* 128bit */
struct cipher_testvec des3_ecb_tv_template_128[] = {
	{
	.key	= "\x10\x46\x10\x34\x89\x98\x80\x20"
		"\x91\x07\xd0\x15\x89\x19\x01\x01",
	.klen	= 16,
	.ptext	= "\x00\x00\x00\x00\x00\x00\x00\x00",
	.ctext	= "\x8C\x78\x59\xEB\x1B\xD7\x4F\x0C",
	.len	= 8,
	}
};

/* 192bit */
struct cipher_testvec des3_cbc_tv_template_192[] = {
	{
	.key	= "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24"
		  "\x44\x4D\x99\x5A\x12\xD6\x40\xC0"
		  "\xEA\xC2\x84\xE8\x14\x95\xDB\xE8",
	.klen	= 24,
	.iv	= "\x7D\x33\x88\x93\x0F\x93\xB2\x42",
	.iv_out	= "\x6b\xfa\xb1\x91\x13\xb0\xd9\x19",
	.ptext	= "\x6f\x54\x20\x6f\x61\x4d\x79\x6e"
		  "\x53\x20\x63\x65\x65\x72\x73\x74"
		  "\x54\x20\x6f\x6f\x4d\x20\x6e\x61"
		  "\x20\x79\x65\x53\x72\x63\x74\x65"
		  "\x20\x73\x6f\x54\x20\x6f\x61\x4d"
		  "\x79\x6e\x53\x20\x63\x65\x65\x72"
		  "\x73\x74\x54\x20\x6f\x6f\x4d\x20"
		  "\x6e\x61\x20\x79\x65\x53\x72\x63"
		  "\x74\x65\x20\x73\x6f\x54\x20\x6f"
		  "\x61\x4d\x79\x6e\x53\x20\x63\x65"
		  "\x65\x72\x73\x74\x54\x20\x6f\x6f"
		  "\x4d\x20\x6e\x61\x20\x79\x65\x53"
		  "\x72\x63\x74\x65\x20\x73\x6f\x54"
		  "\x20\x6f\x61\x4d\x79\x6e\x53\x20"
		  "\x63\x65\x65\x72\x73\x74\x54\x20"
		  "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79",
	.ctext	= "\x0e\x2d\xb6\x97\x3c\x56\x33\xf4"
		  "\x67\x17\x21\xc7\x6e\x8a\xd5\x49"
		  "\x74\xb3\x49\x05\xc5\x1c\xd0\xed"
		  "\x12\x56\x5c\x53\x96\xb6\x00\x7d"
		  "\x90\x48\xfc\xf5\x8d\x29\x39\xcc"
		  "\x8a\xd5\x35\x18\x36\x23\x4e\xd7"
		  "\x76\xd1\xda\x0c\x94\x67\xbb\x04"
		  "\x8b\xf2\x03\x6c\xa8\xcf\xb6\xea"
		  "\x22\x64\x47\xaa\x8f\x75\x13\xbf"
		  "\x9f\xc2\xc3\xf0\xc9\x56\xc5\x7a"
		  "\x71\x63\x2e\x89\x7b\x1e\x12\xca"
		  "\xe2\x5f\xaf\xd8\xa4\xf8\xc9\x7a"
		  "\xd6\xf9\x21\x31\x62\x44\x45\xa6"
		  "\xd6\xbc\x5a\xd3\x2d\x54\x43\xcc"
		  "\x9d\xde\xa5\x70\xe9\x42\x45\x8a"
		  "\x6b\xfa\xb1\x91\x13\xb0\xd9\x19",
	.len	= 128,
	}
};

/* 128bit */
struct cipher_testvec des3_cbc_tv_template_128[] = {
	{
	.key	= "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24"
		"\x44\x4D\x99\x5A\x12\xD6\x40\xC0",
	.klen	= 16,
	.iv	= "\x7D\x33\x88\x93\x0F\x93\xB2\x42",
	.iv_out	= "\x6b\xfa\xb1\x91\x13\xb0\xd9\x19",
	.ptext	= "\x6f\x54\x20\x6f\x61\x4d\x79\x6e"
		"\x53\x20\x63\x65\x65\x72\x73\x74"
		"\x54\x20\x6f\x6f\x4d\x20\x6e\x61"
		"\x20\x79\x65\x53\x72\x63\x74\x65"
		"\x20\x73\x6f\x54\x20\x6f\x61\x4d"
		"\x79\x6e\x53\x20\x63\x65\x65\x72"
		"\x73\x74\x54\x20\x6f\x6f\x4d\x20"
		"\x6e\x61\x20\x79\x65\x53\x72\x63"
		"\x74\x65\x20\x73\x6f\x54\x20\x6f"
		"\x61\x4d\x79\x6e\x53\x20\x63\x65"
		"\x65\x72\x73\x74\x54\x20\x6f\x6f"
		"\x4d\x20\x6e\x61\x20\x79\x65\x53"
		"\x72\x63\x74\x65\x20\x73\x6f\x54"
		"\x20\x6f\x61\x4d\x79\x6e\x53\x20"
		"\x63\x65\x65\x72\x73\x74\x54\x20"
		"\x6f\x6f\x4d\x20\x6e\x61\x0a\x79",
	.ctext	= "\xC2\x3D\x49\x51\x0B\x2E\xA7\x4C"
		"\x8D\x71\x42\x0F\xDD\xFF\xA0\x2D"
		"\x5A\xBD\x2F\x0A\xD5\xAF\xEA\xA3"
		"\x25\x5A\x22\x99\x71\xB0\xE6\x66"
		"\x51\xC2\x31\x79\x82\xEE\x23\xE7"
		"\x98\xCD\xFE\x11\x47\x29\xE3\x01"
		"\x3F\x8F\xCC\x87\x37\x90\xC3\xA9"
		"\x86\xAC\x98\x5C\x2B\x97\xA4\x1E"
		"\xE2\xFD\x51\xEA\xBC\x9F\x20\x4A"
		"\x80\xFC\xA1\xE8\xDE\x93\x34\x01"
		"\xB5\xBF\x6D\xDC\x81\x3E\x71\xB4"
		"\x90\x16\x20\xF0\x4E\x4D\xBC\x95"
		"\x62\xC1\x89\x91\x72\xEB\xF6\xF6"
		"\x58\x4E\x7C\x5B\x73\x17\xD0\x96"
		"\xAF\x15\x97\x0D\x6D\xAB\xD0\xFB"
		"\x2E\xCD\x07\xF2\xF6\xE6\xB0\x75",
	.len	= 128,
	}
};

/* 128bit */
struct cipher_testvec aes_ecb_tv_template_128[] = {
	{
	.key	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
	.klen	= 16,
	.ptext	= "\x00\x11\x22\x33\x44\x55\x66\x77"
		  "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
	.ctext	= "\x69\xc4\xe0\xd8\x6a\x7b\x04\x30"
		  "\xd8\xcd\xb7\x80\x70\xb4\xc5\x5a",
	.len	= 16,
	}
};

/* 192bit */
struct cipher_testvec aes_ecb_tv_template_192[] = {
	{
	.key	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
		  "\x10\x11\x12\x13\x14\x15\x16\x17",
	.klen	= 24,
	.ptext	= "\x00\x11\x22\x33\x44\x55\x66\x77"
		  "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
	.ctext	= "\xdd\xa9\x7c\xa4\x86\x4c\xdf\xe0"
		  "\x6e\xaf\x70\xa0\xec\x0d\x71\x91",
	.len	= 16,
	}
};

/* 128bit */
struct cipher_testvec sm4_cbc_tv_template[] = {
	{
	.key	= "\x01\x23\x45\x67\x89\xAB\xCD\xEF"
		  "\xFE\xDC\xBA\x98\x76\x54\x32\x10",
	.klen	= 16,
	.ptext	= "\xaa\xaa\xaa\xaa\xbb\xbb\xbb\xbb"
		  "\xcc\xcc\xcc\xcc\xdd\xdd\xdd\xdd"
		  "\xee\xee\xee\xee\xff\xff\xff\xff"
		  "\xaa\xaa\xaa\xaa\xbb\xbb\xbb\xbb",
	.iv	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
	.iv_out	= "\x4C\xB7\x01\x69\x51\x90\x92\x26"
		  "\x97\x9B\x0D\x15\xDC\x6A\x8F\x6D",
	.ctext	= "\x78\xEB\xB1\x1C\xC4\x0B\x0A\x48"
		  "\x31\x2A\xAE\xB2\x04\x02\x44\xCB"
		  "\x4C\xB7\x01\x69\x51\x90\x92\x26"
		  "\x97\x9B\x0D\x15\xDC\x6A\x8F\x6D",
	.len	= 32,
	}
};

/* 256bit */
struct cipher_testvec sm4_xts_tv_template[] = {
	{
	.key	= "\x11\x11\x11\x11\x11\x11\x11\x11"
		  "\x11\x11\x11\x11\x11\x11\x11\x11"
		  "\x22\x22\x22\x22\x22\x22\x22\x22"
		  "\x22\x22\x22\x22\x22\x22\x22\x22",
	.klen	= 32,
	.iv	= "\x33\x33\x33\x33\x33\x00\x00\x00"
		  "\x00\x00\x00\x00\x00\x00\x00\x00",
	.ptext	= "\x44\x44\x44\x44\x44\x44\x44\x44"
		  "\x44\x44\x44\x44\x44\x44\x44\x44"
		  "\x44\x44\x44\x44\x44\x44\x44\x44"
		  "\x44\x44\x44\x44\x44\x44\x44\x44",
	.ctext	= "\xA7\x4D\x72\x6C\x11\x19\x6A\x32"
		  "\xBE\x04\xE0\x01\xFF\x29\xD0\xC7"
		  "\x93\x2F\x9F\x3E\xC2\x9B\xFC\xB6"
		  "\x4D\xD1\x7F\x63\xCB\xD3\xEA\x31",
	.len	= 32,
	}
};

/* 256bit */
struct cipher_testvec aes_ecb_tv_template_256[] = {
	{
	.key	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
		  "\x10\x11\x12\x13\x14\x15\x16\x17"
		  "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
	.klen	= 32,
	.ptext	= "\x00\x11\x22\x33\x44\x55\x66\x77"
		  "\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
	.ctext	= "\x8e\xa2\xb7\xca\x51\x67\x45\xbf"
		  "\xea\xfc\x49\x90\x4b\x49\x60\x89",
	.len	= 16,
	}
};

/* 256bit */
struct cipher_testvec aes_xts_tv_template_256[] = {
	{
	.key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
		  "\x11\x11\x11\x11\x11\x11\x11\x11"
		  "\x22\x22\x22\x22\x22\x22\x22\x22"
		  "\x22\x22\x22\x22\x22\x22\x22\x22",
	.klen   = 32,
	.iv     = "\x33\x33\x33\x33\x33\x00\x00\x00"
		  "\x00\x00\x00\x00\x00\x00\x00\x00",
	.ptext	= "\x44\x44\x44\x44\x44\x44\x44\x44"
		  "\x44\x44\x44\x44\x44\x44\x44\x44"
		  "\x44\x44\x44\x44\x44\x44\x44\x44"
		  "\x44\x44\x44\x44\x44\x44\x44\x44",
	.ctext	= "\xc4\x54\x18\x5e\x6a\x16\x93\x6e"
		  "\x39\x33\x40\x38\xac\xef\x83\x8b"
		  "\xfb\x18\x6f\xff\x74\x80\xad\xc4"
		  "\x28\x93\x82\xec\xd6\xd3\x94\xf0",
	.len	= 32,
	}
};

/* 512bit */
struct cipher_testvec aes_xts_tv_template_512[] = {
	{
	.key	= "\x27\x18\x28\x18\x28\x45\x90\x45"
		  "\x23\x53\x60\x28\x74\x71\x35\x26"
		  "\x62\x49\x77\x57\x24\x70\x93\x69"
		  "\x99\x59\x57\x49\x66\x96\x76\x27"
		  "\x31\x41\x59\x26\x53\x58\x97\x93"
		  "\x23\x84\x62\x64\x33\x83\x27\x95"
		  "\x02\x88\x41\x97\x16\x93\x99\x37"
		  "\x51\x05\x82\x09\x74\x94\x45\x92",
	.klen	= 64,
	.iv	= "\xff\x00\x00\x00\x00\x00\x00\x00"
		  "\x00\x00\x00\x00\x00\x00\x00\x00",
	.ptext	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
		  "\x10\x11\x12\x13\x14\x15\x16\x17"
		  "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
		  "\x20\x21\x22\x23\x24\x25\x26\x27"
		  "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
		  "\x30\x31\x32\x33\x34\x35\x36\x37"
		  "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
		  "\x40\x41\x42\x43\x44\x45\x46\x47"
		  "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
		  "\x50\x51\x52\x53\x54\x55\x56\x57"
		  "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
		  "\x60\x61\x62\x63\x64\x65\x66\x67"
		  "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
		  "\x70\x71\x72\x73\x74\x75\x76\x77"
		  "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
		  "\x80\x81\x82\x83\x84\x85\x86\x87"
		  "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
		  "\x90\x91\x92\x93\x94\x95\x96\x97"
		  "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
		  "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
		  "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
		  "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
		  "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
		  "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
		  "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
		  "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
		  "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
		  "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
		  "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
		  "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
		  "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
		  "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
		  "\x10\x11\x12\x13\x14\x15\x16\x17"
		  "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
		  "\x20\x21\x22\x23\x24\x25\x26\x27"
		  "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
		  "\x30\x31\x32\x33\x34\x35\x36\x37"
		  "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
		  "\x40\x41\x42\x43\x44\x45\x46\x47"
		  "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
		  "\x50\x51\x52\x53\x54\x55\x56\x57"
		  "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
		  "\x60\x61\x62\x63\x64\x65\x66\x67"
		  "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
		  "\x70\x71\x72\x73\x74\x75\x76\x77"
		  "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
		  "\x80\x81\x82\x83\x84\x85\x86\x87"
		  "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
		  "\x90\x91\x92\x93\x94\x95\x96\x97"
		  "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
		  "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
		  "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
		  "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
		  "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
		  "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
		  "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
		  "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
		  "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
		  "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
		  "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
		  "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
		  "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
	.ctext	= "\x1c\x3b\x3a\x10\x2f\x77\x03\x86"
		  "\xe4\x83\x6c\x99\xe3\x70\xcf\x9b"
		  "\xea\x00\x80\x3f\x5e\x48\x23\x57"
		  "\xa4\xae\x12\xd4\x14\xa3\xe6\x3b"
		  "\x5d\x31\xe2\x76\xf8\xfe\x4a\x8d"
		  "\x66\xb3\x17\xf9\xac\x68\x3f\x44"
		  "\x68\x0a\x86\xac\x35\xad\xfc\x33"
		  "\x45\xbe\xfe\xcb\x4b\xb1\x88\xfd"
		  "\x57\x76\x92\x6c\x49\xa3\x09\x5e"
		  "\xb1\x08\xfd\x10\x98\xba\xec\x70"
		  "\xaa\xa6\x69\x99\xa7\x2a\x82\xf2"
		  "\x7d\x84\x8b\x21\xd4\xa7\x41\xb0"
		  "\xc5\xcd\x4d\x5f\xff\x9d\xac\x89"
		  "\xae\xba\x12\x29\x61\xd0\x3a\x75"
		  "\x71\x23\xe9\x87\x0f\x8a\xcf\x10"
		  "\x00\x02\x08\x87\x89\x14\x29\xca"
		  "\x2a\x3e\x7a\x7d\x7d\xf7\xb1\x03"
		  "\x55\x16\x5c\x8b\x9a\x6d\x0a\x7d"
		  "\xe8\xb0\x62\xc4\x50\x0d\xc4\xcd"
		  "\x12\x0c\x0f\x74\x18\xda\xe3\xd0"
		  "\xb5\x78\x1c\x34\x80\x3f\xa7\x54"
		  "\x21\xc7\x90\xdf\xe1\xde\x18\x34"
		  "\xf2\x80\xd7\x66\x7b\x32\x7f\x6c"
		  "\x8c\xd7\x55\x7e\x12\xac\x3a\x0f"
		  "\x93\xec\x05\xc5\x2e\x04\x93\xef"
		  "\x31\xa1\x2d\x3d\x92\x60\xf7\x9a"
		  "\x28\x9d\x6a\x37\x9b\xc7\x0c\x50"
		  "\x84\x14\x73\xd1\xa8\xcc\x81\xec"
		  "\x58\x3e\x96\x45\xe0\x7b\x8d\x96"
		  "\x70\x65\x5b\xa5\xbb\xcf\xec\xc6"
		  "\xdc\x39\x66\x38\x0a\xd8\xfe\xcb"
		  "\x17\xb6\xba\x02\x46\x9a\x02\x0a"
		  "\x84\xe1\x8e\x8f\x84\x25\x20\x70"
		  "\xc1\x3e\x9f\x1f\x28\x9b\xe5\x4f"
		  "\xbc\x48\x14\x57\x77\x8f\x61\x60"
		  "\x15\xe1\x32\x7a\x02\xb1\x40\xf1"
		  "\x50\x5e\xb3\x09\x32\x6d\x68\x37"
		  "\x8f\x83\x74\x59\x5c\x84\x9d\x84"
		  "\xf4\xc3\x33\xec\x44\x23\x88\x51"
		  "\x43\xcb\x47\xbd\x71\xc5\xed\xae"
		  "\x9b\xe6\x9a\x2f\xfe\xce\xb1\xbe"
		  "\xc9\xde\x24\x4f\xbe\x15\x99\x2b"
		  "\x11\xb7\x7c\x04\x0f\x12\xbd\x8f"
		  "\x6a\x97\x5a\x44\xa0\xf9\x0c\x29"
		  "\xa9\xab\xc3\xd4\xd8\x93\x92\x72"
		  "\x84\xc5\x87\x54\xcc\xe2\x94\x52"
		  "\x9f\x86\x14\xdc\xd2\xab\xa9\x91"
		  "\x92\x5f\xed\xc4\xae\x74\xff\xac"
		  "\x6e\x33\x3b\x93\xeb\x4a\xff\x04"
		  "\x79\xda\x9a\x41\x0e\x44\x50\xe0"
		  "\xdd\x7a\xe4\xc6\xe2\x91\x09\x00"
		  "\x57\x5d\xa4\x01\xfc\x07\x05\x9f"
		  "\x64\x5e\x8b\x7e\x9b\xfd\xef\x33"
		  "\x94\x30\x54\xff\x84\x01\x14\x93"
		  "\xc2\x7b\x34\x29\xea\xed\xb4\xed"
		  "\x53\x76\x44\x1a\x77\xed\x43\x85"
		  "\x1a\xd7\x7f\x16\xf5\x41\xdf\xd2"
		  "\x69\xd5\x0d\x6a\x5f\x14\xfb\x0a"
		  "\xab\x1c\xbb\x4c\x15\x50\xbe\x97"
		  "\xf7\xab\x40\x66\x19\x3c\x4c\xaa"
		  "\x77\x3d\xad\x38\x01\x4b\xd2\x09"
		  "\x2f\xa7\x55\xc8\x24\xbb\x5e\x54"
		  "\xc4\xf3\x6f\xfd\xa9\xfc\xea\x70"
		  "\xb9\xc6\xe6\x93\xe1\x48\xc1\x51",
	.len	= 512,
	}
};

/* 128bit */
struct cipher_testvec aes_cbc_tv_template_128[] = {
	{
	.key    = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
		  "\x51\x2e\x03\xd5\x34\x12\x00\x06",
	.klen   = 16,
	.iv	= "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
		  "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
	.iv_out	= "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
		  "\x27\x08\x94\x2d\xbe\x77\x18\x1a",
	.ptext	= "Single block msg",
	.ctext	= "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
		  "\x27\x08\x94\x2d\xbe\x77\x18\x1a",
	.len	= 16,
	}
};
/* 192bit */
struct cipher_testvec aes_cbc_tv_template_192[] = {
	/* From NIST SP800-38A */
	{
	.key	= "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
		  "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
		  "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
	.klen	= 24,
	.iv	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
	.iv_out	= "\x08\xb0\xe2\x79\x88\x59\x88\x81"
		  "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd",
	.ptext	= "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
		  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
		  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
		  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
		  "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
		  "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
		  "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
		  "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
	.ctext	= "\x4f\x02\x1d\xb2\x43\xbc\x63\x3d"
		  "\x71\x78\x18\x3a\x9f\xa0\x71\xe8"
		  "\xb4\xd9\xad\xa9\xad\x7d\xed\xf4"
		  "\xe5\xe7\x38\x76\x3f\x69\x14\x5a"
		  "\x57\x1b\x24\x20\x12\xfb\x7a\xe0"
		  "\x7f\xa9\xba\xac\x3d\xf1\x02\xe0"
		  "\x08\xb0\xe2\x79\x88\x59\x88\x81"
		  "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd",
	.len	= 64,
	}
};

struct cipher_testvec aes_ctr_tv_template_128[] = {
	{
	.key	= "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
		  "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
	.klen	= 16,
	.iv	= "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
		  "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
	.iv_out	= "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
		  "\xf8\xf9\xfa\xfb\xfc\xfd\xff\x03",
	.ptext	= "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
		  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
		  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
		  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
		  "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
		  "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
		  "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
		  "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
	.ctext	= "\x87\x4d\x61\x91\xb6\x20\xe3\x26"
		  "\x1b\xef\x68\x64\x99\x0d\xb6\xce"
		  "\x98\x06\xf6\x6b\x79\x70\xfd\xff"
		  "\x86\x17\x18\x7b\xb9\xff\xfd\xff"
		  "\x5a\xe4\xdf\x3e\xdb\xd5\xd3\x5e"
		  "\x5b\x4f\x09\x02\x0d\xb0\x3e\xab"
		  "\x1e\x03\x1d\xda\x2f\xbe\x03\xd1"
		  "\x79\x21\x70\xa0\xf3\x00\x9c\xee",
	.len	= 64,
	}
};

struct cipher_testvec aes_ctr_tv_template_192[] = {
	{
	.key	= "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
		  "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
		  "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
	.klen	= 24,
	.iv	= "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
		  "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
	.iv_out	= "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
		  "\xf8\xf9\xfa\xfb\xfc\xfd\xff\x03",
	.ptext	= "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
		  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
		  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
		  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
		  "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
		  "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
		  "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
		  "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
	.ctext	= "\x1a\xbc\x93\x24\x17\x52\x1c\xa2"
		  "\x4f\x2b\x04\x59\xfe\x7e\x6e\x0b"
		  "\x09\x03\x39\xec\x0a\xa6\xfa\xef"
		  "\xd5\xcc\xc2\xc6\xf4\xce\x8e\x94"
		  "\x1e\x36\xb2\x6b\xd1\xeb\xc6\x70"
		  "\xd1\xbd\x1d\x66\x56\x20\xab\xf7"
		  "\x4f\x78\xa7\xf6\xd2\x98\x09\x58"
		  "\x5a\x97\xda\xec\x58\xc6\xb0\x50",
	.len	= 64,
	}
};

struct cipher_testvec aes_ctr_tv_template_256[] = {
	{
	.key	= "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
		  "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
		  "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
		  "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
	.klen	= 32,
	.iv	= "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
		  "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
	.iv_out	= "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
		  "\xf8\xf9\xfa\xfb\xfc\xfd\xff\x03",
	.ptext	= "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
		  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
		  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
		  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
		  "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
		  "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
		  "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
		  "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
	.ctext	= "\x60\x1e\xc3\x13\x77\x57\x89\xa5"
		  "\xb7\xa7\xf5\x04\xbb\xf3\xd2\x28"
		  "\xf4\x43\xe3\xca\x4d\x62\xb5\x9a"
		  "\xca\x84\xe9\x90\xca\xca\xf5\xc5"
		  "\x2b\x09\x30\xda\xa2\x3d\xe9\x4c"
		  "\xe8\x70\x17\xba\x2d\x84\x98\x8d"
		  "\xdf\xc9\xc5\x8d\xb6\x7a\xad\xa6"
		  "\x13\xc2\xdd\x08\x45\x79\x41\xa6",
	.len	= 64,
	}
};

/* 256bit */
struct cipher_testvec aes_cbc_tv_template_256[] = {
	{
	.key	= "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
		  "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
		  "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
		  "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
	.klen	= 32,
	.iv	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
	.iv_out	= "\xb2\xeb\x05\xe2\xc3\x9b\xe9\xfc"
		  "\xda\x6c\x19\x07\x8c\x6a\x9d\x1b",
	.ptext	= "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
		  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
		  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
		  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
		  "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
		  "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
		  "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
		  "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
	.ctext	= "\xf5\x8c\x4c\x04\xd6\xe5\xf1\xba"
		  "\x77\x9e\xab\xfb\x5f\x7b\xfb\xd6"
		  "\x9c\xfc\x4e\x96\x7e\xdb\x80\x8d"
		  "\x67\x9f\x77\x7b\xc6\x70\x2c\x7d"
		  "\x39\xf2\x33\x69\xa9\xd9\xba\xcf"
		  "\xa5\x30\xe2\x63\x04\x23\x14\x61"
		  "\xb2\xeb\x05\xe2\xc3\x9b\xe9\xfc"
		  "\xda\x6c\x19\x07\x8c\x6a\x9d\x1b",
	.len	= 64,
	}
};

struct cipher_testvec aes_ofb_tv_template_128[] = {
	{
	.key	= "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
		  "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
	.klen	= 16,
	.iv	= "\x00\x01\x02\x03\x04\x05\x06\x07\x08"
		  "\x09\x0a\x0b\x0c\x0d\x0e\x0f",
	.ptext	= "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
		  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
		  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
		  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
		  "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
		  "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
		  "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
		  "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
	.ctext	= "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20"
		  "\x33\x34\x49\xf8\xe8\x3c\xfb\x4a"
		  "\x77\x89\x50\x8d\x16\x91\x8f\x03"
		  "\xf5\x3c\x52\xda\xc5\x4e\xd8\x25"
		  "\x97\x40\x05\x1e\x9c\x5f\xec\xf6"
		  "\x43\x44\xf7\xa8\x22\x60\xed\xcc"
		  "\x30\x4c\x65\x28\xf6\x59\xc7\x78"
		  "\x66\xa5\x10\xd9\xc1\xd6\xae\x5e",
	.len	= 64,
	}
};

//openssl create
struct cipher_testvec aes_ofb_tv_template_192[] = {
	{
	.key	= "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
		  "\xab\xf7\x15\x88\x09\xcf\x4f\x3c"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
	.klen	= 24,
	.iv	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
	.ptext	= "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
		  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
		  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
		  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
		  "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
		  "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
		  "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
		  "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
	.ctext	= "\x6e\x29\x6a\xb1\x64\x8b\x7b\x81"
		  "\xfa\x62\x8f\xfa\xc6\x9f\x48\x6f"
		  "\x32\xe2\xaa\x04\x6a\x81\x04\xb8"
		  "\xc1\xe4\xe5\x1b\xb0\xc1\x89\xca"
		  "\x41\x6d\x43\xf1\x83\xf4\x9d\x90"
		  "\xbf\x68\xe6\xea\xd5\xed\x83\x1c"
		  "\xff\xf2\xf9\xfa\xf8\x3e\xba\x82"
		  "\x7e\xca\x94\x72\x64\x3f\x72\xdf",
	.len	= 64,
	}
};

struct cipher_testvec aes_ofb_tv_template_256[] = {
	{
	.key	= "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
		  "\xab\xf7\x15\x88\x09\xcf\x4f\x3c"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
		  "\x00\x01\x02\x03\x04\x05\x06\x07",
	.klen	= 32,
	.iv	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
	.ptext	= "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
		  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
		  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
		  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
		  "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
		  "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
		  "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
		  "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
	.ctext	= "\x36\x7d\xf9\x01\x2f\x31\xde\x8c"
		  "\x7f\xc1\x26\x1a\xbc\x8a\x35\xe5"
		  "\x00\x24\xad\xcb\x60\x5d\xb9\xea"
		  "\x12\xdd\x0b\xd2\x44\x2a\x24\x51"
		  "\x4f\x13\x1e\x7c\xa2\xad\xe9\x8c"
		  "\x55\x80\x75\xc6\x4d\xf2\x24\xde"
		  "\x30\xa0\xbb\xe7\x6d\xf8\xd1\x23"
		  "\x9d\x9f\xad\xd2\x9f\x87\x4f\x1c",
	.len	= 64,
	}
};


struct cipher_testvec aes_cfb_tv_template_128[] = {
	{ /* From NIST SP800-38A */
	.key	= "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
		  "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
	.klen	= 16,
	.iv	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
	.ptext	= "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
		  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
		  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
		  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
		  "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
		  "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
		  "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
		  "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
	.ctext	= "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20"
		  "\x33\x34\x49\xf8\xe8\x3c\xfb\x4a"
		  "\xc8\xa6\x45\x37\xa0\xb3\xa9\x3f"
		  "\xcd\xe3\xcd\xad\x9f\x1c\xe5\x8b"
		  "\x26\x75\x1f\x67\xa3\xcb\xb1\x40"
		  "\xb1\x80\x8c\xf1\x87\xa4\xf4\xdf"
		  "\xc0\x4b\x05\x35\x7c\x5d\x1c\x0e"
		  "\xea\xc4\xc6\x6f\x9f\xf7\xf2\xe6",
	.len	= 64,
	}
};

struct cipher_testvec aes_cfb_tv_template_192[] = {
	{
	.key	= "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
		  "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
		  "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
	.klen	= 24,
	.iv	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
	.ptext	= "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
		  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
		  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
		  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
		  "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
		  "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
		  "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
		  "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
	.ctext	= "\xcd\xc8\x0d\x6f\xdd\xf1\x8c\xab"
		  "\x34\xc2\x59\x09\xc9\x9a\x41\x74"
		  "\x67\xce\x7f\x7f\x81\x17\x36\x21"
		  "\x96\x1a\x2b\x70\x17\x1d\x3d\x7a"
		  "\x2e\x1e\x8a\x1d\xd5\x9b\x88\xb1"
		  "\xc8\xe6\x0f\xed\x1e\xfa\xc4\xc9"
		  "\xc0\x5f\x9f\x9c\xa9\x83\x4f\xa0"
		  "\x42\xae\x8f\xba\x58\x4b\x09\xff",
	.len	= 64,
	}
};

struct cipher_testvec aes_cfb_tv_template_256[] = {
	{
	.key = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
		  "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
		  "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
		  "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
	.klen	= 32,
	.iv	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
	.ptext	= "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
		  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
		  "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
		  "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
		  "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
		  "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
		  "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
		  "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
	.ctext	= "\xdc\x7e\x84\xbf\xda\x79\x16\x4b"
		  "\x7e\xcd\x84\x86\x98\x5d\x38\x60"
		  "\x39\xff\xed\x14\x3b\x28\xb1\xc8"
		  "\x32\x11\x3c\x63\x31\xe5\x40\x7b"
		  "\xdf\x10\x13\x24\x15\xe5\x4b\x92"
		  "\xa1\x3e\xd0\xa8\x26\x7a\xe2\xf9"
		  "\x75\xa3\x85\x74\x1a\xb9\xce\xf8"
		  "\x20\x31\x62\x3d\x55\xb1\xe4\x71",
	.len	= 64,
	}
};

struct cipher_testvec sm4_ctr_tv_template_128[] = {
	{ /* A.2.5.1 SM4-CTR Example 1 */
	.key	= "\x01\x23\x45\x67\x89\xAB\xCD\xEF"
		  "\xFE\xDC\xBA\x98\x76\x54\x32\x10",
	.klen	= 16,
	.ptext	= "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
		  "\xbb\xbb\xbb\xbb\xbb\xbb\xbb\xbb"
		  "\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc"
		  "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
		  "\xee\xee\xee\xee\xee\xee\xee\xee"
		  "\xff\xff\xff\xff\xff\xff\xff\xff"
		  "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
		  "\xbb\xbb\xbb\xbb\xbb\xbb\xbb\xbb",
	.iv	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
	.iv_out	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0A\x0B\x0C\x0D\x0E\x13",
	.ctext	= "\xac\x32\x36\xcb\x97\x0c\xc2\x07"
		  "\x91\x36\x4c\x39\x5a\x13\x42\xd1"
		  "\xa3\xcb\xc1\x87\x8c\x6f\x30\xcd"
		  "\x07\x4c\xce\x38\x5c\xdd\x70\xc7"
		  "\xf2\x34\xbc\x0e\x24\xc1\x19\x80"
		  "\xfd\x12\x86\x31\x0c\xe3\x7b\x92"
		  "\x6e\x02\xfc\xd0\xfa\xa0\xba\xf3"
		  "\x8b\x29\x33\x85\x1d\x82\x45\x14",
	.len	= 64,
	}
};

struct cipher_testvec sm4_ecb_tv_template_128[] = {
	{ /* A.2.1.1 SM4-ECB Example 1 */
	.key	= "\x01\x23\x45\x67\x89\xAB\xCD\xEF"
		  "\xFE\xDC\xBA\x98\x76\x54\x32\x10",
	.klen	= 16,
	.ptext	= "\xaa\xaa\xaa\xaa\xbb\xbb\xbb\xbb"
		  "\xcc\xcc\xcc\xcc\xdd\xdd\xdd\xdd"
		  "\xee\xee\xee\xee\xff\xff\xff\xff"
		  "\xaa\xaa\xaa\xaa\xbb\xbb\xbb\xbb",
	.ctext	= "\x5e\xc8\x14\x3d\xe5\x09\xcf\xf7"
		  "\xb5\x17\x9f\x8f\x47\x4b\x86\x19"
		  "\x2f\x1d\x30\x5a\x7f\xb1\x7d\xf9"
		  "\x85\xf8\x1c\x84\x82\x19\x23\x04",
	.len	= 32,
	}
};

//openssl create sm4_ofb template
struct cipher_testvec sm4_ofb_tv_template_128[] = {
	{ /* From NIST SP800-38A */
	.key	= "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
		  "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
	.klen	= 16,
	.iv	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
	.ptext	= "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
		  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a",
	.ctext	= "\xbc\x71\x0d\x76\x2d\x07\x0b\x26"
		  "\x36\x1d\xa8\x2b\x54\x56\x5e\x46",
	.len	= 16,
	}
};
//openssl create sm4_cfb template
struct cipher_testvec sm4_cfb_tv_template_128[] = {
	{ /* From NIST SP800-38A */
	.key	= "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
		  "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
	.klen	= 16,
	.iv	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
	.ptext	= "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
		  "\xe9\x3d\x7e\x11\x73\x93\x17\x2a",
	.ctext	= "\xbc\x71\x0d\x76\x2d\x07\x0b\x26"
		  "\x36\x1d\xa8\x2b\x54\x56\x5e\x46",
	.len	= 16,
	}
};

/* 128bit */
struct aead_testvec aes_ccm_tv_template_128[] = {
	{
	.key	= "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
		  "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
	.klen	= 16,
	.iv	= "\x01\x00\x00\x00\x03\x02\x01\x00"
		  "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
	.assoc	= "\x00\x01\x02\x03\x04\x05\x06\x07",
	.alen	= 8,
	.ptext	= "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
		  "\x10\x11\x12\x13\x14\x15\x16\x17"
		  "\x18\x19\x1a\x1b\x1c\x1d\x1e",
	.plen	= 23,
	.ctext	= "\x58\x8c\x97\x9a\x61\xc6\x63\xd2"
		  "\xf0\x66\xd0\xc2\xc0\xf9\x89\x80"
		  "\x6d\x5f\x6b\x61\xda\xc3\x84\x17"
		  "\xe8\xd1\x2c\xfd\xf9\x26\xe0",
	.clen	= 31,
	}
};

/* 192bit */
struct aead_testvec aes_ccm_tv_template_192[] = {
	{
	.key	= "\x56\xdf\x5c\x8f\x26\x3f\x0e\x42"
		  "\xef\x7a\xd3\xce\xfc\x84\x60\x62"
		  "\xca\xb4\x40\xaf\x5f\xc9\xc9\x01",
	.klen	= 24,
	.iv	= "\x03\xd6\x3c\x8c\x86\x84\xb6\xcd"
		  "\xef\x09\x2e\x94\x00\x00\x00\x00",
	.assoc	= "\x02\x65\x78\x3c\xe9\x21\x30\x91"
		  "\xb1\xb9\xda\x76\x9a\x78\x6d\x95"
		  "\xf2\x88\x32\xa3\xf2\x50\xcb\x4c"
		  "\xe3\x00\x73\x69\x84\x69\x87\x79",
	.alen	= 32,
	.ptext	= "\x9f\xd2\x02\x4b\x52\x49\x31\x3c"
		  "\x43\x69\x3a\x2d\x8e\x70\xad\x7e"
		  "\xe0\xe5\x46\x09\x80\x89\x13\xb2"
		  "\x8c\x8b\xd9\x3f\x86\xfb\xb5\x6b",
	.plen	= 32,
	.ctext	= "\x39\xdf\x7c\x3c\x5a\x29\xb9\x62"
		  "\x5d\x51\xc2\x16\xd8\xbd\x06\x9f"
		  "\x9b\x6a\x09\x70\xc1\x51\x83\xc2"
		  "\x66\x88\x1d\x4f\x9a\xda\xe0\x1e"
		  "\xc7\x79\x11\x58\xe5\x6b\x20\x40"
		  "\x7a\xea\x46\x42\x8b\xe4\x6f\xe1",
	.clen	= 48,
	}
};

/* 256bit */
struct aead_testvec aes_ccm_tv_template_256[] = {
	{
	.key	= "\xe0\x8d\x99\x71\x60\xd7\x97\x1a"
		  "\xbd\x01\x99\xd5\x8a\xdf\x71\x3a"
		  "\xd3\xdf\x24\x4b\x5e\x3d\x4b\x4e"
		  "\x30\x7a\xb9\xd8\x53\x0a\x5e\x2b",
	.klen	= 32,
	.iv	= "\x03\x1e\x29\x91\xad\x8e\xc1\x53"
		  "\x0a\xcf\x2d\xbe\x00\x00\x00\x00",
	.assoc	= "\x19\xb6\x1f\x57\xc4\xf3\xf0\x8b"
		  "\x78\x2b\x94\x02\x29\x0f\x42\x27"
		  "\x6b\x75\xcb\x98\x34\x08\x7e\x79"
		  "\xe4\x3e\x49\x0d\x84\x8b\x22\x87",
	.alen	= 32,
	.ptext	= "\xe1\xd9\xd8\x13\xeb\x3a\x75\x3f"
		  "\x9d\xbd\x5f\x66\xbe\xdc\xbb\x66"
		  "\xbf\x17\x99\x62\x4a\x39\x27\x1f"
		  "\x1d\xdc\x24\xae\x19\x2f\x98\x4c",
	.plen	= 32,
	.ctext	= "\x19\xb8\x61\x33\x45\x2b\x43\x96"
		  "\x6f\x51\xd0\x20\x30\x7d\x9b\xc6"
		  "\x26\x3d\xf8\xc9\x65\x16\xa8\x9f"
		  "\xf0\x62\x17\x34\xf2\x1e\x8d\x75"
		  "\x4e\x13\xcc\xc0\xc3\x2a\x54\x2d",
	.clen	= 40,
	}
};

/* 128bit */
struct aead_testvec aes_gcm_tv_template_128[] = {
	{
	.key	= "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
		  "\x6d\x6a\x8f\x94\x67\x30\x83\x08",
	.klen	= 16,
	.iv	= "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
		  "\xde\xca\xf8\x88",
	.ptext	= "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
		  "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
		  "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
		  "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
		  "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
		  "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
		  "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
		  "\xba\x63\x7b\x39\x1a\xaf\xd2\x55",
	.plen	= 64,
	.ctext	= "\x42\x83\x1e\xc2\x21\x77\x74\x24"
		  "\x4b\x72\x21\xb7\x84\xd0\xd4\x9c"
		  "\xe3\xaa\x21\x2f\x2c\x02\xa4\xe0"
		  "\x35\xc1\x7e\x23\x29\xac\xa1\x2e"
		  "\x21\xd5\x14\xb2\x54\x66\x93\x1c"
		  "\x7d\x8f\x6a\x5a\xac\x84\xaa\x05"
		  "\x1b\xa3\x0b\x39\x6a\x0a\xac\x97"
		  "\x3d\x58\xe0\x91\x47\x3f\x59\x85"
		  "\x4d\x5c\x2a\xf3\x27\xcd\x64\xa6"
		  "\x2c\xf3\x5a\xbd\x2b\xa6\xfa\xb4",
	.clen	= 80,
	}
};

/* 192bit */
struct aead_testvec aes_gcm_tv_template_192[] = {
	{
	.key	= "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
		  "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
		  "\xfe\xff\xe9\x92\x86\x65\x73\x1c",
	.klen	= 24,
	.iv	= "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
		  "\xde\xca\xf8\x88",
	.ptext	= "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
		  "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
		  "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
		  "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
		  "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
		  "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
		  "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
		  "\xba\x63\x7b\x39\x1a\xaf\xd2\x55",
	.plen	= 64,
	.ctext	= "\x39\x80\xca\x0b\x3c\x00\xe8\x41"
		  "\xeb\x06\xfa\xc4\x87\x2a\x27\x57"
		  "\x85\x9e\x1c\xea\xa6\xef\xd9\x84"
		  "\x62\x85\x93\xb4\x0c\xa1\xe1\x9c"
		  "\x7d\x77\x3d\x00\xc1\x44\xc5\x25"
		  "\xac\x61\x9d\x18\xc8\x4a\x3f\x47"
		  "\x18\xe2\x44\x8b\x2f\xe3\x24\xd9"
		  "\xcc\xda\x27\x10\xac\xad\xe2\x56"
		  "\x99\x24\xa7\xc8\x58\x73\x36\xbf"
		  "\xb1\x18\x02\x4d\xb8\x67\x4a\x14",
	.clen	= 80,
	}
};

/* 256bit */
struct aead_testvec aes_gcm_tv_template_256[] = {
	{
	.key	= "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
		  "\x6d\x6a\x8f\x94\x67\x30\x83\x08"
		  "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
		  "\x6d\x6a\x8f\x94\x67\x30\x83\x08",
	.klen	= 32,
	.iv	= "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
		  "\xde\xca\xf8\x88",
	.ptext	= "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
		  "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
		  "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
		  "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
		  "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
		  "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
		  "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
		  "\xba\x63\x7b\x39",
	.plen	= 60,
	.assoc	= "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
		  "\xfe\xed\xfa\xce\xde\xad\xbe\xef"
		  "\xab\xad\xda\xd2",
	.alen	= 20,
	.ctext	= "\x52\x2d\xc1\xf0\x99\x56\x7d\x07"
		  "\xf4\x7f\x37\xa3\x2a\x84\x42\x7d"
		  "\x64\x3a\x8c\xdc\xbf\xe5\xc0\xc9"
		  "\x75\x98\xa2\xbd\x25\x55\xd1\xaa"
		  "\x8c\xb0\x8e\x48\x59\x0d\xbb\x3d"
		  "\xa7\xb0\x8b\x10\x56\x82\x88\x38"
		  "\xc5\xf6\x1e\x63\x93\xba\x7a\x0a"
		  "\xbc\xc9\xf6\x62"
		  "\x76\xfc\x6e\xce\x0f\x4e\x17\x68"
		  "\xcd\xdf\x88\x53\xbb\x2d\x55\x1b",
	.clen	= 76,
	}
};

struct aead_testvec hmac_sha256_aes_cbc_tv_temp[] = {
	{
#ifdef __LITTLE_ENDIAN
	.key	= "\x08\x00"		/* rta length */
		  "\x01\x00"		/* rta type */
#else
	.key	= "\x00\x08"		/* rta length */
		  "\x00\x01"		/* rta type */
#endif
		  "\x00\x00\x00\x10"	/* enc key length */
		  "\x20\x21\x22\x23\x24\x25\x26\x27"
		  "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
		  "\x30\x31\x32\x33\x34\x35\x36\x37"
		  "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
		  "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
		  "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
	.klen	= 8 + 32 + 16,
	.iv	= "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
		  "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
	.assoc	= "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
		  "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
	.alen	= 16,
	.ptext	= "\x00\x01\x02\x03\x04\x05\x06\x07"
		  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
		  "\x10\x11\x12\x13\x14\x15\x16\x17"
		  "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
	.plen	= 32,
	.ctext	= "\xd2\x96\xcd\x94\xc2\xcc\xcf\x8a"
		  "\x3a\x86\x30\x28\xb5\xe1\xdc\x0a"
		  "\x75\x86\x60\x2d\x25\x3c\xff\xf9"
		  "\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1"
		  "\xf5\x33\x53\xf3\x68\x85\x2a\x99"
		  "\x0e\x06\x58\x8f\xba\xf6\x06\xda"
		  "\x49\x69\x0d\x5b\xd4\x36\x06\x62"
		  "\x35\x5e\x54\x58\x53\x4d\xdf\xbf",
	.clen	= 32 + 32,
	}
};

/* 128bit */
struct aead_testvec sm4_ccm_tv_template_128[] = {
	{
	.key	= "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
		  "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
	.klen	= 16,
	.iv	= "\x01\x00\x00\x00\x03\x02\x01\x00"
		  "\xa0\xa1\xa2\xa3\xa4\xa5\x00\x00",
	.assoc	= "\x00\x01\x02\x03\x04\x05\x06\x07",
	.alen	= 8,
	.ptext	= "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
		  "\x10\x11\x12\x13\x14\x15\x16\x17"
		  "\x18\x19\x1a\x1b\x1c\x1d\x1e",
	.plen	= 23,
	.ctext	= "\x7B\xFF\x4A\x15\xF5\x73\xCE\x82"
		  "\x6E\xC2\x31\x1D\xE2\x53\x02\xAC"
		  "\xA4\x48\xF9\xE4\xF5\x1F\x81\x70"
		  "\x18\xBC\xB6\x84\x01\xB8\xAE",
	.clen	= 31,
	}
};

/* 128bit */
struct aead_testvec sm4_gcm_tv_template_128[] = {
	{
	.key	= "\xfe\xff\xe9\x92\x86\x65\x73\x1c"
		  "\x6d\x6a\x8f\x94\x67\x30\x83\x08",
	.klen	= 16,
	.iv	= "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
		  "\xde\xca\xf8\x88",
	.ptext	= "\xd9\x31\x32\x25\xf8\x84\x06\xe5"
		  "\xa5\x59\x09\xc5\xaf\xf5\x26\x9a"
		  "\x86\xa7\xa9\x53\x15\x34\xf7\xda"
		  "\x2e\x4c\x30\x3d\x8a\x31\x8a\x72"
		  "\x1c\x3c\x0c\x95\x95\x68\x09\x53"
		  "\x2f\xcf\x0e\x24\x49\xa6\xb5\x25"
		  "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57"
		  "\xba\x63\x7b\x39\x1a\xaf\xd2\x55",
	.plen	= 64,
	.ctext	= "\xe4\x11\x0f\xf1\xc1\x41\x97\xe6"
		  "\x76\x21\x6a\x33\x83\x10\x41\xeb"
		  "\x09\x58\x00\x11\x7b\xdc\x3f\x75"
		  "\x1a\x49\x6e\xfc\xf2\xbb\xdf\xdb"
		  "\x3a\x2e\x13\xfd\xc5\xc1\x9d\x07"
		  "\x1a\xe5\x48\x3f\xed\xde\x98\x5d"
		  "\x3f\x2d\x5b\x4e\xee\x0b\xb6\xdf"
		  "\xe3\x63\x36\x83\x23\xf7\x5b\x80"
		  "\x7d\xfe\x77\xef\x71\xb1\x5e\xc9"
		  "\x52\x6b\x09\xab\x84\x28\x4b\x8a",
	.clen	= 80,
	}
};

struct hash_testvec sm3_tv_template[] = {
/*	{
		.plaintext = "abc",
		.psize = 3,
		.digest = "\x66\xC7\xF0\xF4\x62\xEE\xED\xD9"
			"\xD1\xF2\xD4\x6B\xDC\x10\xE4\xE2"
			"\x41\x67\xC4\x87\x5C\xF2\xF7\xA2"
			"\x29\x7D\xA0\x2B\x8F\x4B\xA8\xE0",
	}*/
	{
		.plaintext = "abcdefghijklmnopqrstuvwxyz",
		.psize = 26,
		.digest = "\xB8\x0F\xE9\x7A\x4D\xA2\x4A\xFC"
			"\x27\x75\x64\xF6\x6A\x35\x9E\xF4"
			"\x40\x46\x2A\xD2\x8D\xCC\x6D\x63"
			"\xAD\xB2\x4D\x5C\x20\xA6\x15\x95",
	}
};

struct hash_testvec hmac_sm3_tv_template[] = {
	{
		.key	= "Jefe",
		.ksize	= 4,
		.plaintext = "what do ya want for nothing?",
		.psize	= 28,
		.digest	= "\x2e\x87\xf1\xd1\x68\x62\xe6\xd9"
			"\x64\xb5\x0a\x52\x00\xbf\x2b\x10"
			"\xb7\x64\xfa\xa9\x68\x0a\x29\x6a"
			"\x24\x05\xf2\x4b\xec\x39\xf8\x82",
	},
};

struct hash_testvec md5_tv_template[] = {
	{
		.plaintext = "abcdefghijklmnopqrstuvwxyz",
		.psize	= 26,
		.digest	= "\xc3\xfc\xd3\xd7\x61\x92\xe4\x00"
			"\x7d\xfb\x49\x6c\xca\x67\xe1\x3b",
	}
};

struct hash_testvec hmac_md5_tv_template[] =
{
	{
		.key	= "Jefe",
		.ksize	= 4,
		.plaintext = "what do ya want for nothing?",
		.psize	= 28,
		.digest	= "\x75\x0C\x78\x3E\x6A\xB0\xB5\x03"
			 "\xEA\xA8\x6E\x31\x0A\x5D\xB7\x38"
	},
};

struct hash_testvec sha1_tv_template[] = {
	{
		.plaintext = "abc",
		.psize	= 3,
		.digest	= "\xa9\x99\x3e\x36\x47\x06\x81\x6a\xba\x3e"
			  "\x25\x71\x78\x50\xc2\x6c\x9c\xd0\xd8\x9d",
	}
};

struct hash_testvec hmac_sha1_tv_template[] = {
	{
		.key	= "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
		.ksize	= 20,
		.plaintext = "Hi There",
		.psize	= 8,
		.digest	= "\xb6\x17\x31\x86\x55\x05\x72\x64"
			  "\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1"
			  "\x46\xbe",
	}
};

struct hash_testvec sha256_tv_template[] = {
	{
		.plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
		.psize	= 64,
		.digest = "\xb5\xfe\xad\x56\x7d\xff\xcb\xa4"
			"\x2c\x32\x29\x32\x19\xbb\xfb\xfa"
			"\xd6\xff\x94\xa3\x72\x91\x85\x66"
			"\x3b\xa7\x87\x77\x58\xa3\x40\x3a",
	}
};

struct hash_testvec hmac_sha256_tv_template[] = {
	{
		.key	= "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
			"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
			"\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
		.ksize	= 32,
		.plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
			"\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
			"\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
			"\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
		.psize	= 50,
		.digest	= "\xcd\xcb\x12\x20\xd1\xec\xcc\xea"
			"\x91\xe5\x3a\xba\x30\x92\xf9\x62"
			"\xe5\x49\xfe\x6c\xe9\xed\x7f\xdc"
			"\x43\x19\x1f\xbd\xe4\x5c\x30\xb0",
	}
};

struct hash_testvec sha224_tv_template[] = {
	{
		.plaintext = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
		.psize	= 64,
		.digest = "\xc4\xdb\x2b\x3a\x58\xc3\x99\x01"
			"\x42\xfd\x10\x92\xaa\x4e\x04\x08"
			"\x58\xbb\xbb\xe8\xf8\x14\xa7\x0c"
			"\xef\x3b\xcb\x0e",
	}
};

struct hash_testvec hmac_sha224_tv_template[] = {
	{
		.key    = "Jefe",
		.ksize  = 4,
		/* ("what do ya want for nothing?") */
		.plaintext = "\x77\x68\x61\x74\x20\x64\x6f\x20"
			"\x79\x61\x20\x77\x61\x6e\x74\x20"
			"\x66\x6f\x72\x20\x6e\x6f\x74\x68"
			"\x69\x6e\x67\x3f",
		.psize  = 28,
		.digest = "\xa3\x0e\x01\x09\x8b\xc6\xdb\xbf"
			"\x45\x69\x0f\x3a\x7e\x9e\x6d\x0f"
			"\x8b\xbe\xa2\xa3\x9e\x61\x48\x00"
			"\x8f\xd0\x5e\x44",
	}
};

struct hash_testvec sha384_tv_template[] = {
	{
		.plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
			"hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
		.psize	= 112,
		.digest	= "\x09\x33\x0c\x33\xf7\x11\x47\xe8"
			"\x3d\x19\x2f\xc7\x82\xcd\x1b\x47"
			"\x53\x11\x1b\x17\x3b\x3b\x05\xd2"
			"\x2f\xa0\x80\x86\xe3\xb0\xf7\x12"
			"\xfc\xc7\xc7\x1a\x55\x7e\x2d\xb9"
			"\x66\xc3\xe9\xfa\x91\x74\x60\x39",
	}
};

struct hash_testvec hmac_sha384_tv_template[] = {
	{
		.key	= "Jefe",
		.ksize	= 4,
		.plaintext = "what do ya want for nothing?",
		.psize	= 28,
		.digest	= "\xaf\x45\xd2\xe3\x76\x48\x40\x31"
			"\x61\x7f\x78\xd2\xb5\x8a\x6b\x1b"
			"\x9c\x7e\xf4\x64\xf5\xa0\x1b\x47"
			"\xe4\x2e\xc3\x73\x63\x22\x44\x5e"
			"\x8e\x22\x40\xca\x5e\x69\xe2\xc7"
			"\x8b\x32\x39\xec\xfa\xb2\x16\x49",
	}
};

struct hash_testvec sha512_tv_template[] = {
	{
		.plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
		.psize	= 56,
		.digest	= "\x20\x4a\x8f\xc6\xdd\xa8\x2f\x0a"
			"\x0c\xed\x7b\xeb\x8e\x08\xa4\x16"
			"\x57\xc1\x6e\xf4\x68\xb2\x28\xa8"
			"\x27\x9b\xe3\x31\xa7\x03\xc3\x35"
			"\x96\xfd\x15\xc1\x3b\x1b\x07\xf9"
			"\xaa\x1d\x3b\xea\x57\x78\x9c\xa0"
			"\x31\xad\x85\xc7\xa7\x1d\xd7\x03"
			"\x54\xec\x63\x12\x38\xca\x34\x45",
	}
};

struct hash_testvec hmac_sha512_tv_template[] = {
	{
		.key	= "Jefe",
		.ksize	= 4,
		.plaintext = "what do ya want for nothing?",
		.psize	= 28,
		.digest	= "\x16\x4b\x7a\x7b\xfc\xf8\x19\xe2"
			  "\xe3\x95\xfb\xe7\x3b\x56\xe0\xa3"
			  "\x87\xbd\x64\x22\x2e\x83\x1f\xd6"
			  "\x10\x27\x0c\xd7\xea\x25\x05\x54"
			  "\x97\x58\xbf\x75\xc0\x5a\x99\x4a"
			  "\x6d\x03\x4f\x65\xf8\xf0\xe6\xfd"
			  "\xca\xea\xb1\xa3\x4d\x4a\x6b\x4b"
			  "\x63\x6e\x07\x0a\x38\xbc\xe7\x37",
	}
};

struct hash_testvec sha512_224_tv_template[] = {
	{
		.plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
		.psize	= 56,
		.digest	= "\xe5\x30\x2d\x6d\x54\xbb\x24\x22"
			"\x75\xd1\xe7\x62\x2d\x68\xdf\x6e"
			"\xb0\x2d\xed\xd1\x3f\x56\x4c\x13"
			"\xdb\xda\x21\x74",
	}
};

struct hash_testvec hmac_sha512_224_tv_template[] = {
	{
		.key	= "Jefe",
		.ksize	= 4,
		.plaintext = "what do ya want for nothing?",
		.psize	= 28,
		.digest	= "\x4a\x53\x0b\x31\xa7\x9e\xbc\xce"
			"\x36\x91\x65\x46\x31\x7c\x45\xf2"
			"\x47\xd8\x32\x41\xdf\xb8\x18\xfd"
			"\x37\x25\x4b\xde",
	},
};

struct hash_testvec sha512_256_tv_template[] = {
	{
		.plaintext = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
		.psize	= 56,
		.digest	= "\xbd\xe8\xe1\xf9\xf1\x9b\xb9\xfd"
			"\x34\x06\xc9\x0e\xc6\xbc\x47\xbd"
			"\x36\xd8\xad\xa9\xf1\x18\x80\xdb"
			"\xc8\xa2\x2a\x70\x78\xb6\xa4\x61",
	}
};

struct hash_testvec hmac_sha512_256_tv_template[] = {
	{
		.key	= "Jefe",
		.ksize	= 4,
		.plaintext = "what do ya want for nothing?",
		.psize	= 28,
		.digest	= "\x6d\xf7\xb2\x46\x30\xd5\xcc\xb2"
			"\xee\x33\x54\x07\x08\x1a\x87\x18"
			"\x8c\x22\x14\x89\x76\x8f\xa2\x02"
			"\x05\x13\xb2\xd5\x93\x35\x94\x56",
	},
};

struct hash_testvec long_hash_tv_template[] = {
	{
/*
md5	(stdin)= A89D2C8730E3BB304EDA507035928B86
sha1	(stdin)= D2E8068B6B648B8793B7DA8D575AE57FA208FD66
sha256	(stdin)= 1CEA48E3960EE3675BD5663C5F423325110000D26DE11C9B11B0293386C030C0
sha224	(stdin)= ADBEC39512DCA87CCFD155BB635F519E7B46796C722CC650233BF106
sha384	(stdin)= 18AB6F0018884BBF7CE7015168B691FEC8A2E15892689E4D632099162
		54A2A6B527D2DFC0144D5CEECC339857B968308
 */
		.key	= "Huawei12",
		.ksize	= 8,
		.plaintext = "\x09\x9f\x13\xaa\x41\x68\x4c\xe3"
			"\x5a\x11\x85\xac\xb3\x27\xbe\x55"
			"\xec\x60\xf7\x8d\x02\x99\x30\xc7"
			"\x4b\xd2\x69\x23\x74\x0b\xa2\x16"
			"\xad\x44\xdb\x4f\xe6\x7d\x14\x88"
			"\x2f\xb6\x2a\xc1\x58\xef\x63\xfa"
			"\x71\x05\x9c\x33\xca\x3e\xd5\x6c"
			"\x23\x77\x0e\xa5\x19\xb0\x47\xde"
			"\x52\x65\x80\x17\x8b\x22\xb9\x2d"
			"\xc4\x5b\xf2\x66\xfd\x94\x08\x9f"
			"\x36\xcd\x41\xd8\x6f\x06\x7a\x11"
			"\xa8\x1c\xb3\x4a\xe1\x55\xec\x83"
			"\x1a\x8e\x25\xbc\x70\xc7\x5e\xf5"
			"\x69\x00\x97\x0b\xa2\x39\xd0\x44"
			"\xdb\x72\x09\x7d\x14\xab\x1f\xb6"
			"\x4d\x87\x58\xef\x86\x1d\x91\x28"
			"\xbf\x33\xca\x61\xf8\x6c\x03\x9a"
			"\x0e\xa5\x3c\xd3\x49\xde\x75\x0c"
			"\x80\x17\xae\x22\xb9\x50\xe7\x5b"
			"\xf2\x90\x20\x67\x2b\xc2\x36\xcd"
			"\x64\xfb\x6f\x06\x9d\x11\xa8\x3f"
			"\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
			"\x25\xbc\x53\xea\x5e\xf5\x8c\x00"
			"\x97\x45\xc5\x39\xd0\x67\xfe\x72"
			"\x09\xa0\x14\xab\x02\xd9\x4d\xe4"
			"\x0e\xa5\x3c\xd3\x49\xde\x75\x0c"
			"\xed\x61\xf8\x8f\x03\x9a\x31\xc8"
			"\x3c\xd3\x67\x01\x75\x0c\xa3\x17"
			"\xae\x45\xdc\x50\xe7\x7e\x15\x89"
			"\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
			"\x92\x06\x9d\x33\xca\x3e\xd5\x6c"
			"\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
			"\x53\xea\x81\x18\x8c\x23\xba\x2e"
			"\xc5\x5c\xf3\x67\xfe\x95\x09\xa0"
			"\x37\xce\x42\xd9\x70\x07\x7b\x12"
			"\xa9\x1d\xb4\x4b\xe2\x56\xed\x84"
			"\x1b\x8f\x26\xbd\x31\xc8\x5f\xf6"
			"\x6a\x01\x98\x0c\xa3\x3a\xd1\x45"
			"\xdc\x73\x0a\x7e\x15\xac\x20\xb7"
			"\xd6\x4a\xe1\x78\x0f\x83\x1a\xb1"
			"\xc0\x34\xcb\x62\xf9\x6d\x04\x9b"
			"\x0f\xa6\x3d\xd4\x48\xdf\x76\x0d"
			"\x81\x18\xaf\x23\xba\x51\xe8\x5c"
			"\xf3\x8a\x21\x95\x2c\xc3\x37\xce"
			"\x65\xfc\x70\x07\x9e\x12\xa9\x40"
			"\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
			"\x26\xbd\x54\xbd\x31\xc8\x5f\xf6"
			"\x98\x2f\xc6\x3a\xd1\x68\xff\x73"
			"\x0a\xa1\x15\xac\x43\xda\x4e\xe5"
			"\x7c\x13\x87\x1e\xb5\x29\xc0\x57"
			"\xee\x62\xf9\x90\x04\x9b\x32\xc9"
			"\x3d\xd4\x6b\x02\x76\x0d\xa4\x18"
			"\xaf\x46\xdd\x51\xe8\x7f\x16\x8a"
			"\x21\xb8\x2c\xc3\x5a\xf1\x65\xfc"
			"\x93\x07\x9e\x35\xcc\x40\xd7\x6e"
			"\x05\x79\x10\xa7\x1b\xb2\x49\xe0"
			"\x20\xb7\x2b\xc2\x59\xf0\x64\xfb"
			"\x92\x06\x9d\x33\xca\x3e\xd5\x6c"
			"\x04\x78\x0f\xa6\x1a\xb1\x48\xdf"
			"\xaa\x1e\xb5\x4c\xe3\x57\xee\x85"
			"\x1c\x90\x27\xbe\x32\xc9\x60\xf7"
			"\x6b\x02\x99\x0d\xa4\x3b\xd2\x46"
			"\xdd\x74\x0b\x7f\x16\xad\x21\xb8"
			"\xd7\x4b\xe2\x79\x10\x84\x1b\xb2"
			"\x26\xbd\x54\xbd\x31\xc8\x5f\xf6"
			"\x10\xa7\x3e\xd5\x49\xe0\x77\x0e"
			"\x82\x19\xb0\x24\xbb\x52\xe9\x5d"
			"\xf4\x8b\x22\x96\x2d\xc4\x38\xcf"
			"\x66\xfd\x71\x98\x9f\x13\xaa\x41"
			"\xd8\x4c\xe3\x7a\x11\x85\x1c\xb3"
			"\x27\xbe\x55\xec\x60\xf7\x8e\x02"
			"\x99\x30\xc7\x3b\xd2\x69\x00\x74"
			"\x0b\xa2\x16\xad\x44\xdb\x4f\xe6"
			"\x7d\x14\x88\x1f\xb6\x2a\xc1\x58"
			"\xef\x78\xfa\x91\x05\x9c\x33\xca"
			"\x3e\xd5\x6c\x03\x77\x0e\xa5\x19"
			"\xb0\x47\xde\x52\xe9\x80\x17\x8b"
			"\x22\xb9\x2d\xc4\x5b\xf2\x66\xfd"
			"\x94\x08\x9f\x36\xcd\x41\xd8\x6f"
			"\x06\x7a\x11\xa8\x56\xb3\x4a\xe1"
			"\x55\xec\x83\x1a\x8e\x25\xbc\x30"
			"\xc7\x5e\xf5\x69\x00\x97\x0b\xa2"
			"\x05\x79\x10\xa7\x1b\x09\x7d\x14"
			"\xab\x1f\xb6\x4d\xe4\x58\xef\x86"
			"\x1d\x91\x28\xbf\x33\xca\x61\xf8"
			"\x6c\x03\x9a\x0e\xa5\x3c\xd3\x47"
			"\xde\x75\x0c\x80\x17\xae\x22\xb9"
			"\x50\xe7\x5b\xf2\x89\x20\x94\x2b"
			"\xc2\x36\xcd\x64\xfb\x6f\x06\x9d"
			"\x11\xa8\x3f\xd6\x4a\xe1\x78\x0f"
			"\x83\x1a\xb1\x25\xbc\x53\xea\x5e"
			"\xf5\x8c\x00\x97\x2e\xc5\x39\xd0"
			"\x67\xfe\x72\x09\xa0\x14\xab\x42"
			"\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
			"\x28\xbf\x56\xed\x61\xf8\x8f\x03"
			"\x9a\x31\xc8\x3c\xd3\x6a\x01\x75"
			"\x0c\xec\x83\x1a\x8e\x25\xbc\x30"
			"\x7e\x15\x89\x20\xb7\x2b\xc2\x59"
			"\xf0\x64\xfb\x92\x06\x9d\x34\xcb"
			"\x3f\xd6\x6d\x04\x78\x0f\xa6\x1a"
			"\xb1\x48\xff\x53\xea\x81\x18\x8c"
			"\x23\xba\x2e\xc5\x5c\xf3\x67\xfe"
			"\x95\x09\x34\x37\xce\x42\xd9\x70"
			"\x07\x7b\x12\xa9\x1d\xb4\x4b\xe2"
			"\x56\xed\x84\x1b\x8f\x26\xbd\x31"
			"\x45\x5f\xf6\x6a\x01\x98\x0c\xa3"
			"\x3a\xd1\x45\xdc\x73\x0a\x7e\x15"
			"\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
			"\x1e\x92\x29\xc0\x25\xcb\x62\xf9"
			"\x6d\x04\x9b\x0f\xa6\x3d\xd4\x48"
			"\xdf\x76\x0d\x81\x18\xaf\x23\xba"
			"\x51\xe8\x5c\x1a\x8e\x25\xbc\x30"
			"\xc3\x37\xce\x65\xfc\x70\x07\x9e"
			"\x12\xa9\x40\xd7\x4b\xe2\x79\x10"
			"\x84\x1b\xb2\x26\xbd\x54\xeb\x5f"
			"\xf6\x8d\x01\x98\x2f\xc6\x3a\xd1"
			"\x68\xff\x73\x0a\xa1\x15\xac\x43"
			"\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
			"\x29\xc0\x57\xee\x62\xf9\x90\x04"
			"\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
			"\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
			"\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
			"\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
			"\xd9\x4d\xe4\x7b\x12\x86\x1d\xb4"
			"\xb2\x49\xe0\x54\xeb\x82\x19\x8d"
			"\x24\xbb\x2f\xc6\x5d\xf4\x68\xff"
			"\x96\x0a\x45\x38\xcf\x43\xda\x71"
			"\x08\x7c\x13\xaa\x1e\x76\x4c",
		.psize     = 1023,
	}
};

struct hash_testvec hmac_abnormal1024_tv_template[] = {
	{
		.key	= "\xab\xfc\x93\x07\x9e\xaa\xbc\x0f"
			  "\x68\xff\x73\x0a\xa1\x15\xac\x43"
			  "\xda\x4e\xe5\x7c\x13\x87\x1e\xb5"
			  "\x29\xc0\x57\xee\x62\xf9\x90\x04"
			  "\x9b\x32\xc9\x3d\xd4\x6b\x02\x76"
			  "\x0d\xa4\x18\xaf\x46\xdd\x51\xe8"
			  "\x7f\x16\x8a\x21\xb8\x2c\xc3\x5a"
			  "\xf1\x65\xfc\x93\x07\x9e\x35\xcc"
			  "\x07\xd0\x15\x89\x19\x01\x01\xa2"
			  "\x54\x18\x5e\x6a\x16\x93\x6e\x56"
			  "\x43\x19\x1f\xbd\xe4\x5c\x30\xb0"
			  "\x67\x17\x21\xc7\x6e\x8a\xd5\x49"
			  "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
			  "\x97\x9b\x0f\x15\x56\x6a\x8f\x6d"
			  "\x21\x2f\x2c\x02\xa4\xe0\x78\x65"
			  "\xbc\x53\xea\x5e\xf5\x8c\x00\xa3"
			  "\xab\xca\x0f\x0e",
		.ksize	= 132,
		.plaintext = "Test Using Texts"
			   "r Than BlockSize"
			   "e aKey Hash Keys"
			   " First",
		.psize	= 54,
	}
};

struct hash_testvec hmac_abnormal512_tv_template[] = {
        {
                .key    = "\x07\xd0\x15\x89\x19\x01\x01\xa2"
                          "\x54\x18\x5e\x6a\x16\x93\x6e\x56"
                          "\x43\x19\x1f\xbd\xe4\x5c\x30\xb0"
                          "\x67\x17\x21\xc7\x6e\x8a\xd5\x49"
                          "\xac\x20\xb7\x4e\xe5\x59\xf0\x87"
                          "\x97\x9b\x0f\x15\x56\x6a\x8f\x6d"
                          "\x21\x2f\x2c\x02\xa4\xe0\x78\x65"
                          "\xbc\x53\xea\x5e\xf5\x8c\x00\xa3"
                          "\xab\xca\x0f\x68",
                .ksize  = 68,
                .plaintext = "Test Using Texts"
                             "r Than BlockSize"
                             "e aKey Hash Keys"
                             " First",
                .psize  = 54,
        }
};


#endif
